<template>
  <div>
<el-table
        :data="MyProjectDesc"
        style="width: 100%">
        
        <el-table-column
          prop="defectName"
          label="缺陷名称"
          >
        </el-table-column>
        <el-table-column
          prop="projectName"
          label="项目"
          >
        </el-table-column>

        <el-table-column
          prop="defectDesc"
          label="缺陷描述"
          >
        </el-table-column>
        <el-table-column
          prop="defectType"
          label="缺陷分类"
          >
        </el-table-column>
        <el-table-column
          prop="defectSevsrity"
          label="严重程度"
          >
        </el-table-column>
        <el-table-column
          prop="defectPriority"
          label="优先级"
          >
        </el-table-column>

        <el-table-column label="预计工时"
                          prop="planWorkHours">

        </el-table-column>
        <el-table-column
          prop="actWorkHours"
          label="完成工时"
          >
        </el-table-column>
        <el-table-column
          prop="doneRatio"
          label="完成进度"
          >
        </el-table-column>

        </el-table>
        <el-pagination
               fixed
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="pages.current"
               :page-sizes="[1, 2, 3, 4]"
               :page-size="pages.size"
               layout="total, sizes, prev, pager, next, jumper"
               :total="pages.total">
             </el-pagination>
             </div>
</template>

<script>
  export default{
    name:"myprojectdesc",
    data(){
      return{
      MyProjectDesc:[],
      pages:{}
      }
    },
    methods:{
      getAllMyProjectDesc(current,size){
        this.$http.post("projectInfo/getMyPeojectDesc",{"current":current,
                                                        "size":size,
                                                        "projectName":localStorage.getItem("projectName"),
                                                        "accountName":JSON.parse(localStorage.getItem("loginUser")).accountName

        }).then(resp=>{
          this.MyProjectDesc=resp.data.data.records
          this.pages=resp.data.data
        })
      },
      handleSizeChange(val){

        this.pages.size=val
        this.getAllMyProjectDesc(this.pages.num,val)
      },
      handleCurrentChange(val){
        this.pages.current=val
        this.getAllMyProjectDesc(val,this.pages.size)
          },
    },
      created() {
        this.getAllMyProjectDesc(1,3)
      }
  }
</script>

<style>
</style>
